package com.vchello.bean.message;

import java.io.Serializable;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.vchello.bean.user.User;

/**
 * 
 * @author power
 *
 */
@TableName("message")
public class Message extends Model<Message> {

	private static final long serialVersionUID = 1L;

	@TableId("id")
	private int id;

	@TableField("send_user_id")
	private int sendUserId;

	@TableField("receive_user_id")
	private int receiveUserId;      //管理员发送所有用户receiveUserId为0

	@TableField("title")
	private String title;

	@TableField("status")
	private int status;

	@TableField("is_read")
	private int isRead;

	@TableField("is_success")
	private int isSuccess;

	@TableField("content")
	private String content;

	@TableField("create_time")
	private String createTime;
	
	@TableField(exist=false)
	private User sendUser;
	
	@TableField(exist=false)
	private User receiveUser;

	public Message(){}
	
	public Message(int sendUserId, int receiveUserId, String title, int status, int isRead, int isSuccess,
			String content, String createTime) {
		super();
		this.sendUserId = sendUserId;
		this.receiveUserId = receiveUserId;
		this.title = title;
		this.status = status;
		this.isRead = isRead;
		this.isSuccess = isSuccess;
		this.content = content;
		this.createTime = createTime;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getSendUserId() {
		return sendUserId;
	}

	public void setSendUserId(int sendUserId) {
		this.sendUserId = sendUserId;
	}

	public int getReceiveUserId() {
		return receiveUserId;
	}

	public void setReceiveUserId(int receiveUserId) {
		this.receiveUserId = receiveUserId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getIsRead() {
		return isRead;
	}

	public void setIsRead(int isRead) {
		this.isRead = isRead;
	}

	public int getIsSuccess() {
		return isSuccess;
	}

	public void setIsSuccess(int isSuccess) {
		this.isSuccess = isSuccess;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public User getSendUser() {
		return sendUser;
	}

	public void setSendUser(User sendUser) {
		this.sendUser = sendUser;
	}

	public User getReceiveUser() {
		return receiveUser;
	}

	public void setReceiveUser(User receiveUser) {
		this.receiveUser = receiveUser;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

}